package com.phonegap.breastmilk;

import com.phonegap.breastmilk.R;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;

public class AndroidTabsActivity extends TabActivity {
	
	private TabHost.TabSpec specJournal, specFeeding, specFacts;
	protected TabHost tabs = null;
	public static AndroidTabsActivity self;
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	self = this;
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.main);
        Resources res = getResources();
        
        this.tabs=(TabHost)findViewById(android.R.id.tabhost);
        this.tabs.setup();

        specFeeding = this.tabs.newTabSpec("tab1");
        specFeeding.setContent(new Intent(this, TabFeeding.class));
        specFeeding.setIndicator("Feeding", res.getDrawable(android.R.drawable.ic_btn_speak_now));
        this.tabs.addTab(specFeeding);
        
        specJournal = this.tabs.newTabSpec("tab2");
        specJournal.setContent(new Intent(this, TabJournal.class));
        specJournal.setIndicator("Journal", res.getDrawable(android.R.drawable.ic_dialog_info));
        this.tabs.addTab(specJournal);
        
        specFacts = this.tabs.newTabSpec("tab3");
        specFacts.setContent(new Intent(this, TabFacts.class));
        specFacts.setIndicator("Facts", res.getDrawable(android.R.drawable.ic_dialog_map));
        this.tabs.addTab(specFacts);
        
        this.tabs.setCurrentTab(0);
        
    } 
}